package com.fs.common.baseMapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fs.common.pojo.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

/**
 * @author ACE
 * @desc 用户mapper
 * @creationTime 2019-04-03 20:44
 * @projectName weixinframe
 * @packageName com.fs.base.mapper
 */
@Mapper
public interface UserMapper extends BaseMapper<User> {

    User findByAccountAndPwd(@Param("account") String account,@Param("pwd") String pwd);

    Page<User> findList(IPage page, @Param("map")Map map);

    User findByMobileAndPwd(@Param("mobile") String mobile, @Param("pwd") String pwd);

    @Select("select * from s_user where decoder = #{decoder}")
    User findOneByDecoder(@Param("decoder") String decoder);

    @Select("select count(*) from s_user u where u.create_time >= #{nowDate}")
    int findTodayNewUser(String nowDate);
}
